// TOWN DIALOGUE SCRIPT
//    Town 30: Cavern of Giants

begintalkscript;

variables;

short i,j,k,r1,choice;

// Prisoner

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Prisoner";
	text1 = "You find a human prisoner, a warrior of the Empire army. He's dressed in rags but is in good shape otherwise. He jumps up to greet you. _A rescuer! I knew I shouldn't give up hope. Can I escape now?_";
	text5 = "The prisoner jumps up. _Greetings, rescuer! Is there a safe route for me to reach the exit?_";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	question = "_How long have you been imprisoned?_";
	text1 = "_I have no idea, I've lost track. I'm so relieved you're here! I was afraid I was abandoned by the Empire army. Can you help me escape?_";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_Nobody else has come to try to rescue you?_";
	text1 = "_Who knows? The Empire has done so little good against the giants, I thought there was no hope of rescue! Now that you're here, there's hope! Can you help me escape?_";

begintalknode;
	state = 2;
	nextstate = -1;
	question = "_I'm not with the Empire._";
	text1 = "You get a skeptical look. _You're not with the Empire army? Then who are you?_ Then the prisoner shrugs. _Oh, what does it matter, just as long as you can rescue me._";

begintalknode;
	state = 1;
	nextstate = -1;
	question = "_Why are you still alive?_";
	text1 = "_The giants haven't gotten hungry yet, I guess._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(30,0) == 0;
	question = "_I have freed you!_";
	text1 = "_Have you found a way I can sneak out without running into a giant?_ You haven't.";
	text2 = "Oh dear. I have no chance of sneaking out the front gate. And I can't go below either. I'd get killed. Have you found some sort of more concealed way out?_ You haven't. _I'd better stay here then. Likely death is better than certain death._";
	action = END_TALK;


begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(30,0) > 0;
	question = "_I have cleared a route for you to escape._ (Describe a way out.)";
	text1 = "_Oh dear. I have no chance of sneaking out the front gate. And I can't go below either. I'd get killed. Have you found some sort of more concealed way out?_ You describe the hidden, brush-filled exit you found.";
	text2 = "_Thank you! I may die sneaking out, but at least I won't just be butchered in this hole._ He slips out of the chamber and runs for his life.";
	action = END_TALK;
	code =
		if (gf(31,24) == 0)
			erase_char(3002);
		if (gf(31,24) == 1)
			erase_char(3057);
		if (gf(31,24) == 2)
			erase_char(3000);
		if (gf(31,24) == 3)
			erase_char(3001);
		sf(31,16 + gf(31,24),1);
	break;
